---
title: Getting Started
description: How to use Jimp
---

import { Steps } from "@astrojs/starlight/components";
import { Aside } from "@astrojs/starlight/components";

Jimp (JavaScript Image Manipulation Program) is a package that makes it easy to load and manipulate images in the browser and Node.js.
It aims to run anywhere that JavaScript is supported.

[Read the full documentation](/api/jimp/classes/jimp/) to learn more about the API.

```bash
pnpm add jimp
```

Jimp supports the following image formats:

- [bmp](https://en.wikipedia.org/wiki/BMP_file_format)
- [gif](https://en.wikipedia.org/wiki/GIF)
- [jpeg](https://en.wikipedia.org/wiki/JPEG)
- [png](https://en.wikipedia.org/wiki/Portable_Network_Graphics)
- [tiff](https://en.wikipedia.org/wiki/TIFF)

<Aside type="caution" title="Watch out!">
  Jimp is built on JavaScript implementations of image formats. These
  implementations are not optimized for performance and may allocate a lot of
  memory before using.
</Aside>

## Usage

The workflow for using jimp

<Steps>

1. Load an image.

   ```ts
   import { Jimp } from "jimp";

   const image = await Jimp.read("test/image.png");
   ```

2. Manipulate the image.

   ```ts
   image.resize({ width: 100 });
   ```

3. Save the image.

   ```ts
   await image.write("test/output.png");
   ```

</Steps>
